﻿/**********************************天使物流*******************************************
* 功能描述:结算管理-付款管理
* 作者:石锦涛
* 时间:2022-01-12
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.SettleAccounts.PaymentApplys;
using Volo.Abp.Application.Services;

namespace TianShiProject.SettleAccounts.PaymentApplys
{
    public class PaymentApp:ApplicationService
    {
        private readonly IPaymentApplyReposiyory _paymentApplyReposiyory;
        public PaymentApp(IPaymentApplyReposiyory paymentApplyReposiyory)
        {
            _paymentApplyReposiyory = paymentApplyReposiyory;
        }

        /// <summary>
        /// 付款分页显示
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<PaymentApplyDto>> GetPayment(string tilet, string times, int? state, string name, int pageindex = 1, int pagesize = 5)
        {
            try
            {
                return await _paymentApplyReposiyory.GetPayment(tilet, times, state, name, pageindex, pagesize);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        ///  付款逻辑删除
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<PaymentApplyDto>> DeletePayment(int Id)
        {
            try
            {
                return await _paymentApplyReposiyory.DeletePayment(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 修改付款
        /// </summary>
        /// <param name="newInput"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> UpdatePayment(PaymentApplyDto applyDto)
        {
            try
            {
                return await _paymentApplyReposiyory.UpdatePayment(applyDto);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 新增付款
        /// </summary>
        /// <param name="newInput"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> PostPayment(PaymentApplyDto applyDto)
        {
            try
            {
                return await _paymentApplyReposiyory.PostPayment(applyDto);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量逻辑删除付款
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task<PageResponse<PaymentApplyDto>> DeletePaymentMent(string Id)
        {
            try
            {
                return await _paymentApplyReposiyory.DeletePaymentMent(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }


    }
}
